<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: PRP Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_p_r_p.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="class_p_r_p-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PRP Class Reference<div class="ingroups"><a class="el" href="group___b_p.html">Basic Primitives</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="prp_8h_source.html">prp.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab468217e923c01101f6890ee985dc2a0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#ab468217e923c01101f6890ee985dc2a0">PRP</a> (const char *seed=<a class="el" href="utils_2block_8h.html#a1a61c940fcdfab9d717ed2f9c27f3602">fix_key</a>)</td></tr>
<tr class="separator:ab468217e923c01101f6890ee985dc2a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d816cb4ec0ff0adc3207ebf1c3bb3ed"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a5d816cb4ec0ff0adc3207ebf1c3bb3ed">~PRP</a> ()</td></tr>
<tr class="separator:a5d816cb4ec0ff0adc3207ebf1c3bb3ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa65b400126715a3fc74a48caf2bc7c79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#aa65b400126715a3fc74a48caf2bc7c79">aes_set_key</a> (const char *key)</td></tr>
<tr class="separator:aa65b400126715a3fc74a48caf2bc7c79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67994b9b20d8931e54367be52523b237"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a67994b9b20d8931e54367be52523b237">aes_set_key</a> (const <a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> &amp;v)</td></tr>
<tr class="separator:a67994b9b20d8931e54367be52523b237"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a696f4a94e96b00fc9ac52c8ef0d16836"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a696f4a94e96b00fc9ac52c8ef0d16836">permute_block</a> (<a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *data, int nblocks)</td></tr>
<tr class="separator:a696f4a94e96b00fc9ac52c8ef0d16836"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85bdec3c6f5a6873e9c96f03fa952542"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a85bdec3c6f5a6873e9c96f03fa952542">permute_data</a> (uint8_t *data, int nbytes)</td></tr>
<tr class="separator:a85bdec3c6f5a6873e9c96f03fa952542"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27497c4db9526ca6a8df4fd4db9782d0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a27497c4db9526ca6a8df4fd4db9782d0">H</a> (<a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> in, uint64_t id)</td></tr>
<tr class="separator:a27497c4db9526ca6a8df4fd4db9782d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac767954d3739c873783e3eacb3b1ae4a"><td class="memTemplParams" colspan="2">template&lt;int n&gt; </td></tr>
<tr class="memitem:ac767954d3739c873783e3eacb3b1ae4a"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#ac767954d3739c873783e3eacb3b1ae4a">H</a> (<a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> out[n], <a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> in[n], uint64_t id)</td></tr>
<tr class="separator:ac767954d3739c873783e3eacb3b1ae4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c66bfbad2a249941d9f2133fc955fa1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#a1c66bfbad2a249941d9f2133fc955fa1">Hn</a> (<a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *out, <a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *in, uint64_t id, int length, <a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *scratch=nullptr)</td></tr>
<tr class="separator:a1c66bfbad2a249941d9f2133fc955fa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:abbb7cb3f37a26e14c411c83d9ad4cc92"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_a_e_s___k_e_y.html">AES_KEY</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_r_p.html#abbb7cb3f37a26e14c411c83d9ad4cc92">aes</a></td></tr>
<tr class="separator:abbb7cb3f37a26e14c411c83d9ad4cc92"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ab468217e923c01101f6890ee985dc2a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab468217e923c01101f6890ee985dc2a0">&sect;&nbsp;</a></span>PRP()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">PRP::PRP </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>seed</em> = <code><a class="el" href="utils_2block_8h.html#a1a61c940fcdfab9d717ed2f9c27f3602">fix_key</a></code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a5d816cb4ec0ff0adc3207ebf1c3bb3ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d816cb4ec0ff0adc3207ebf1c3bb3ed">&sect;&nbsp;</a></span>~PRP()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">PRP::~PRP </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa65b400126715a3fc74a48caf2bc7c79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa65b400126715a3fc74a48caf2bc7c79">&sect;&nbsp;</a></span>aes_set_key() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::aes_set_key </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a67994b9b20d8931e54367be52523b237"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67994b9b20d8931e54367be52523b237">&sect;&nbsp;</a></span>aes_set_key() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::aes_set_key </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> &amp;&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a27497c4db9526ca6a8df4fd4db9782d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27497c4db9526ca6a8df4fd4db9782d0">&sect;&nbsp;</a></span>H() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> PRP::H </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a>&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ac767954d3739c873783e3eacb3b1ae4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac767954d3739c873783e3eacb3b1ae4a">&sect;&nbsp;</a></span>H() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int n&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::H </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a>&#160;</td>
          <td class="paramname"><em>out</em>[n], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a>&#160;</td>
          <td class="paramname"><em>in</em>[n], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a1c66bfbad2a249941d9f2133fc955fa1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c66bfbad2a249941d9f2133fc955fa1">&sect;&nbsp;</a></span>Hn()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::Hn </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *&#160;</td>
          <td class="paramname"><em>scratch</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a696f4a94e96b00fc9ac52c8ef0d16836"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a696f4a94e96b00fc9ac52c8ef0d16836">&sect;&nbsp;</a></span>permute_block()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::permute_block </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nblocks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a85bdec3c6f5a6873e9c96f03fa952542"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85bdec3c6f5a6873e9c96f03fa952542">&sect;&nbsp;</a></span>permute_data()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void PRP::permute_data </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="abbb7cb3f37a26e14c411c83d9ad4cc92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbb7cb3f37a26e14c411c83d9ad4cc92">&sect;&nbsp;</a></span>aes</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_a_e_s___k_e_y.html">AES_KEY</a>* PRP::aes</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/Users/wangxiao/git/emp-toolkit/emp-tool/utils/<a class="el" href="prp_8h_source.html">prp.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_p_r_p.html">PRP</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
